<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Benchmark: string "multiplication"</title>
    <script type="text/javascript" src="benchmarker.js"></script>
    <script type="text/javascript">
/* <![CDATA[ */
new Benchmarker(
  {
    concat: function() {
      var ret = text, bin = times.toString(2);
      for (var i = 1; i < bin.length; i++) {
        ret += ret;
        if (bin.charAt(i) === '1') ret = ret + text;
      }
      return ret;
    },
    join: function() {
      var ret = [];
      for (var i = 0; i < times; i++)
        ret.push(text);
      return ret.join('');
    }
  },
  {
    setup: function() {
      times    = 1000;
      text     = "foo bar baz";
    }
  }
);
/* ]]> */
    </script>
  </head>
  <body>
  </body>
</html>
